The present invention relates to web user interfaces and more particularly to a method and system for maintaining scroll position in a web user interface or the like.
Web based user interfaces commonly suffer from a usability issue related to scrolling. The issue is that a browser's scrollbar position is lost when a hypertext mark-up language (HTML) or similar language page is reloaded via an automated refresh, when a user or operator activates or clicks on a hyperlink or a similar operation that may cause a change in the page. This forces the user to manually scroll the resulting HTML page back to the location or scroll position of interest after the page has reloaded. FIGS. 1A and 1B are an example of an HTML page 100 that is reloaded. In FIG. 1A, the HTML page 100 has been by scrolled by a user or operator to a selected scroll position 102 in a web user interface 104 presentable by a browser (not shown). The HTML page 100 may be scroll to the selected scroll position 102 by moving a vertical slider 106 in a vertical scroll bar 108 and a horizontal slider 110 in a horizontal scroll bar 112. The HTML page 100 may be scrolled to the selected position 102 to display an artifact 114 or a selected portion of the page 100 of interest substantially completely within the web user interface 104. If the page 100 is reloaded or refreshed for any reason, the page 100 may not be scrolled or positioned in the selected scroll position 102 after the reload or refresh event and the artifact 114 or selected portion of the page 100 may not be completely viewable by the user as shown in FIG. 1B. Having to manually re-scroll the page 100 to substantially completely view the artifact 114 or page portion of interest after each refresh event or similar event can be aggravating and time consuming.
A current solution to the scrolling issue is for application developers to add named anchor points to their HTML. Using this technique, anchor elements, e.g., <A href=“#name1”>, may be added at predetermined locations in the HTML page. When the page is reloaded, the browser automatically positions the page at one of the named anchor points. One shortcoming of this named anchor point approach is that the anchor elements can only be positioned at certain predetermined points in the HTML document or page, and therefore cannot always scroll the user back to the exact spot where the user may have positioned or scrolled the HTML page before the reload occurred. This can result in the page appearing to “jump” between reloads, which can also be aggravating or tiresome to the user.
Another shortcoming of the named anchor approach is that the user may manually scroll the page to a position that differs from a location anticipated by the developer when creating the named anchor. For example, the developer may expect the user to always be focused on a certain location in the page, such as an event viewer or the like, and the developer will create a universal resource locator (URL) for the page reload which references the named anchor at that spot or location. However, a user may want to set the scroll position at some other location but does not have the flexibility under the named anchor approach.